package com.stox.services.data.provider.manager;

import java.util.Date;
import java.util.List;

import com.stox.services.data.provider.manager.impl.BarManagerImpl;
import com.stox.shared.core.model.Bar;
import com.stox.shared.core.model.enumeration.BarSpan;
import com.stox.shared.core.model.filter.BarCriteria;

public interface BarManager {
	
	BarManager INSTANCE = BarManagerImpl.INSTANCE;
	
	public Bar getLast(Long scripId, BarSpan barSpan);

	public List<Bar> findByScripId(Long scripId);
	
	public List<Bar> find(BarCriteria barCriteria); 

	public List<Bar> findByScripId(Long scripId,final int count);
	
	public List<Bar> findByScripId(Long scripId, final Date start);
	
	public List<Bar> findByScripId(Long scripId, final Date start, final Date end);
	
	public List<Bar> findByScripId(Long scripId, BarSpan spanType, Date start, Date end);
	
	public List<Bar> findByScripId(Long scripId, BarSpan spanType, Date start,int count);
	
	public List<Bar> findByScripId(Long scripId, BarSpan barSpan, Integer offset, Integer count);
	
	public void save(List<Bar> bars);
	
	public void flush();
	
}
